﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ThreeDPrinting.ORM;
using System.Data.Objects;
using System.Data;
using ThreeDPrinting.Entity;
using System.Collections;

namespace ThreeDPrinting
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //using (DBEntities entities = new DBEntities())
            //{
            ////    //Insert a Record
            ////    //===================================
            ////    //Create the member mem obect
            //tblmember mem = new tblmember();
            ////    //fill the object with data
            ////    mem.memberName = "Steve Oakes";
            ////    mem.memberBOD = DateTime.Today;
            ////    //Call the method to add the object to the table
            ////    entities.tblmembers.Add(mem);
            ////    //Save the changes to the DB
            ////    entities.SaveChanges();
            ////    //mem.Id will contain the record number 

            ////    //Update a record
            ////    //==================================
            ////    //mem = entities.tblMembers.SingleOrDefault(p => p.Id == mem.Id);
            ////    mem.memberName = "Steveo Oakes";
            ////    entities.SaveChanges();

            ////    //Delete a record
            ////    //==================================
            ////    //mem = entities.tblMembers.SingleOrDefault(p => p.Id == mem.Id);
            ////    entities.tblmembers.Remove(mem);
            ////    entities.SaveChanges();
            //GridView1.DataSource = entities.tblmembers.ToList();
            //GridView1.DataBind();
            ////tblmember mem1 = entities.GetMemberById(5);
            //}

            ////DisplayXML
            //if (!IsPostBack)
            //{
            //    DataSet productCatalog = new DataSet();
            //    productCatalog.ReadXml(MapPath("~/Assets/Catalog/productCatalog.xml"));
            //    Repeater1.DataSource = productCatalog;
            //    Repeater1.DataBind();
            //}

            //Check to make sure query string is not empty
            //if (!String.IsNullOrEmpty(Request.QueryString["Item"]))
            //{
            //    //?Item=1234
            //    string cartItem = (Request.QueryString["Item"]);
            //    ShoppingCart sc = ShoppingCart.SetShoppingCart(cartItem);
            //    //Save the object in a Web Session
            //    Session["cart"] = sc;
            //    Response.Redirect("~/Pages/Cart/");
            //}

        }
    }
}